package com.lsj.spring.config;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @author Lsj
 * @version 1.0
 * @date 2021/6/26 16:38
 * component把普通的实例pojo实例化到spring容器中
 * 相当于配置文件中的<ben id="" class=""></>
 * propertySource是加载指定的配置文件
 */
@Data
@Component
@PropertySource("classpath:jdbc.properties")
public class JdbcConfig {
    @Value("${jdbc.driver}")
    private String driver;
    @Value("${jdbc.url}")
    private String url;
    @Value("${jdbc.username}")
    private String username;
    @Value("${jdbc.password}")
    private String password;
    @Value("${jdbc.max}")
    private int max;
    @Value("${jdbc.min}")
    private int min;
}
